﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Sudoku.Lang;

namespace Sudoku.Menu
{
	public class HintButton : LabelButton
	{

		public short HintsLeft { get; set; }
		protected Rectangle hintRect;
		protected Texture2D hintTexture;

		public HintButton(Game game, Rectangle r, short hints, SpriteFont font, Color color)
			: base(game, r, LocalizedStrings.ButtonHint, font, color, LabelStyle.BOTTOM)
		{
			HintsLeft = hints;
			if (HintsLeft == 0) this.Enabled = false;

			hintRect = new Rectangle(rect.X + (int)(rect.Width * 0.75f) - 25, rect.Y + (int)(rect.Height * 0.25f) - 25, 50, 50);
			hintTexture = textureService.Texture("HintNumbers");
		}

		public override void Draw(GameTime gameTime)
		{
			base.Draw(gameTime);
			
			spriteBatch.Begin();

			spriteBatch.Draw(hintTexture, hintRect, new Rectangle( (HintsLeft) * 50, 0, 50, 50), Color.White);

			spriteBatch.End();
		}

	}
}
